// 库存管理筛选值
export const OtherOutSearchSelect =  (data:any, value: any)=>{

    const {
        barcode, //条码
        batch, //批次
        brand, //品牌
        class_one, //一级类目
        class_two, //二级类目
        goods_name, //产品名称
        in_order_type, //入库类型
        inventory_check_type, //盘点方案
        inventory_status, //状态
        out_order_type, //出库类型
        out_status, //出库状态
        series, //系列
        spec_no, //编码
        wms_owner, //货主
        wms_warehouse, //仓库
        type_all_name, //业务类型
     } = data

    if (value == 'owner_no' || value == 'warehouse_no') {
        return wms_owner.map((item:any)=>{
            return { value: item.owner_no, label: item.short_name }
        })
    }
    if (value == 'batch_no') {
        return batch.map((item:any)=>{
            return { value: item.batch_no != '空' ? item.batch_no : '0', label: item.batch_no }
        })
    }
    if (value == 'status') {
        return out_status.map((item:any)=>{
            return { value: item.id, label: item.name }
        })
    }
    if (value == 'make_status') {
        return inventory_status.map((item:any)=>{
            return { value: item.id, label: item.name }
        })
    }
    if (value == 'src_order_type') {
        return out_order_type.map((item:any)=>{
            return { value: item.id, label: item.name }
        })
    }
    if (value == 'src_order_type_in') {
        return in_order_type.map((item:any)=>{
            return { value: item.id, label: item.name }
        })
    }
    if (value == 'check_type') {
        return inventory_check_type.map((item:any)=>{
            return { value: item.id, label: item.name }
        })
    }
    if (value == 'assistant_id') {
        return brand.map((item:any)=>{
            return { value: item.entry_id, label: item.name }
        })
    }
    if (value == 'class_id1') {
        return class_one.map((item:any)=>{
            return { value: item.id, label: item.data_title }
        })
    }
    if (value == 'class_id2') {
        return class_two.map((item:any)=>{
            return { value: item.id, label: item.data_title }
        })
    }
    if (value == 'xl_id') {
        return series.map((item:any)=>{
            return { value: item.id, label: item.data_title }
        })
    }
    if (value == 'barcode') {
        return barcode.map((item:any)=>{
            return { value: item.barcode, label: item.barcode }
        })
    }
    if (value == 'number') {
        return spec_no.map((item:any)=>{
            return { value: item.spec_no, label: item.spec_no }
        })
    }
    if (value == 'name') {
        return goods_name.map((item:any)=>{
            return { value: item.goods_name, label: item.goods_name }
        })
    }
    if (value == 'type_name') {
        return type_all_name.map((item:any)=>{
            return { value: item.name, label: item.name }
        })
    }
    if (value == 'wms_warehouse') {
        return wms_warehouse.map((item:any)=>{
            return { value: item.warehouse_no, label: item.name }
        })
    }
    return []
}

/**
 * 其他出库
 */
export const OtherOutSearch = [
    {  label: '仓库', prop: 'owner_no', type: 'select', multiple: true },
    {  label: '状态', prop: 'status', type: 'select', multiple: true, isall: true },
    {  label: '出库类型', prop: 'src_order_type', type: 'select', multiple: true, isall: true },
    {  label: '出库单号', prop: 'stockout_no', type: 'input', multiple: false },
    {  label: '创建日期', prop: 'create_time', type: 'time', multiple: true },
    {  label: '发货时间', prop: 'out_time', type: 'time', multiple: true },
    {  label: '制单人', prop: 'operator_name', type: 'input', multiple: true },
]
export const OtherOutCloums = [
    { label: '仓库', prop: 'short_name', width: '120', },
    { label: '出库单号', prop: 'stockout_no', width: '160',},
    { label: '出库类型', prop: 'src_order_type_str', width: '100' },
    { label: '状态', prop: 'status_str', width: '80' },
    { label: '发货状态', prop: 'aaa', width: '90' },
    { label: '回传状态', prop: 'aaa', width: '90' },
    { label: '制单人', prop: 'operator_name', width: '80' },
    { label: '拣货员', prop: 'picker_name', width: '80', type: '' },
    { label: '验货员', prop: 'examiner_name', width: '80', type: '' },
    { label: '物流公司', prop: 'logistics_name', width: '100', type: '' },
    { label: '物流单号', prop: 'logistics_no', width: '120', type: '' },
    { label: '邮费', prop: 'post_cost', width: '80', type: 'money' },
    { label: '实际总重量', prop: 'weight', width: '100', type: 'money' },
    { label: '预估总重量', prop: 'calc_weight', width: '100', type: 'money' },
    { label: '货品数量', prop: 'goods_count', width: '100', type: 'number' },
    { label: '货品种类数', prop: 'goods_type_count', width: '100', type: 'number' },
    { label: '备注', prop: 'remark', type: '' },
    { label: '仓储单号', prop: 'src_order_no', type: '', width: '150' },
    { label: '创建时间', prop: 'trade_check_time', type: '', width: '160' },
    { label: '发货时间', prop: 'consign_time', type: '', width: '160' },

]
export const OtherOutDetailCloums = [
    { label: '产品编码', prop: 'spec_no', },
    { label: '条形码', prop: 'barcode'},
    { label: '产品名称', prop: 'name', width: '260'  },
    { label: '品牌', prop: 'brand',  },
    { label: '数量', prop: 'num', type: 'number'  },
    // { label: '预估重量', prop: 'aaa',  },
    // { label: '预估总重量', prop: 'aaa',  },
    { label: '批次', prop: 'batch_no', type: '' },
    { label: '有效期', prop: 'expire_date', type: '' },
    // { label: '单据时间', prop: 'logistics_name', type: '' },
    // { label: '操作人', prop: 'logistics_no', type: '' },
    { label: '备注', prop: 'remark', type: '' },
]

/**
 * 其他入库
 */
/**
 * @secrch
 * @param
 * label 标题
 * prop 字段
 * type select 下拉 input 输入
 * isall 筛选项是否有 全部项
 */
export const OtherInSearch = [
    {  label: '仓库', prop: 'owner_no', type: 'select', multiple: true },
    {  label: '入库类型', prop: 'src_order_type_in', type: 'select', multiple: true, isall: true },
    {  label: '入库单号', prop: 'stockin_no', type: 'input', multiple: false },
    {  label: '入库时间', prop: 'in_time', type: 'time', multiple: true },
    // {  label: '审核时间', prop: 'stockin_time', type: 'time', multiple: true },
]
/**
 * @cloums
 * @param
 * label 标题
 * prop 字段
 * type number 数字类型 money 金钱 ''默认  custom 自定义
 */
export const OtherInCloums = [
    { label: '仓库', prop: 'short_name', width: '160', },
    { label: '入库单号', prop: 'stockin_no', width: '140',},
    { label: '状态', prop: 'status_str', type: '', width: '70' },
    { label: '入库类型', prop: 'src_order_type_str', width: '100' },
    { label: '创建人', prop: 'operator_name', width: '70' },
    { label: '入库人', prop: 'stockin_operator_name', width: '70' },
    { label: '物流公司', prop: 'logistics_name', width: '100' },
    { label: '物流单号', prop: 'logistics_no', width: '100', type: '' },
    { label: '货品数量', prop: 'goods_count', width: '120', type: 'number' },
    { label: '货品种类数', prop: 'goods_type_count', width: '100', type: 'number' },
    { label: '总体积', prop: 'volume', width: '140', type: 'money' },
    { label: '总重量', prop: 'weight', width: '100', type: 'money' },
    // { label: '箱规总箱数', prop: 'weight', width: '100', type: 'number' },
    { label: '备注', prop: 'calc_weight', width: '90', type: '' },
    { label: '修改时间', prop: 'modified', width: '160', type: '' },
    { label: '提交时间', prop: 'created', width: '160', type: '' },
    { label: '审核时间', prop: 'stockin_time', width: '160', type: '' },
]

// 其它入库详情
export const OtherInDetailCloums = [
    { label: '产品编码', prop: 'spec_no', width: 150, type: '' },
    { label: '条形码', prop: 'barcode', width: 140, type: '' },
    // { label: '货品编码', prop: 'AAAA', width: 100, type: '' },
    { label: '产品名称', prop: 'name', width: 240, type: '' },
    { label: '品牌', prop: 'brand', width: 100, type: '' },
    { label: '货位', prop: 'position_no', width: 100, type: '' },
    { label: '生产日期', prop: 'product_date', width: 160, type: '' },
    { label: '有效期', prop: 'expire_date', width: 160, type: '' },
    { label: '批次', prop: 'batch_no', width: 120, type: '' },
    { label: '数量', prop: 'batch_num', width: 100, type: 'number' },
    { label: '重量', prop: 'AAAA', width: 100, type: 'money' },
    { label: '备注', prop: 'AAAA', width: 100, type: '' },
    { label: '总重量', prop: 'AAAA', width: 100, type: 'money' },
    { label: '体积', prop: 'AAAA', width: 100, type: 'money' },
    { label: '总体积', prop: 'AAAA', width: 100, type: 'money' },
    // { label: '箱规', prop: 'AAAA', width: 100, type: '' },
    // { label: '箱数', prop: 'AAAA', width: 100, type: 'number' },
]

/**
 * *******************库存盘点**********************
 */
export const MakeWarehouseSearch = [
    {  label: '仓库', prop: 'owner_no', type: 'select', multiple: true },
    // {  label: '货主', prop: 'owner_no', type: 'select', multiple: true },
    {  label: '状态', prop: 'make_status', type: 'select', multiple: true, isall: true },
    {  label: '盘点方案', prop: 'check_type', type: 'select', multiple: true },
    {  label: '创建日期', prop: 'created_time', type: 'time', multiple: false },
    {  label: '修改时间', prop: 'updated_time', type: 'time', multiple: false },
    {  label: '盘点单号', prop: 'check_order_no', type: 'input', multiple: false },
]
export const MakeWarehouseCloums = [
    { label: '仓库', prop: 'short_name', },
    { label: '盘点单号', prop: 'check_order_no',},
    { label: '创建人', prop: 'status_str' },
    { label: '盘点人', prop: 'src_order_type_str' },
    { label: '盘点方案', prop: 'check_type_str' },
    // { label: '入库人', prop: 'stockin_operator_name', width: '70' },
    { label: '状态', prop: 'AAA' },
    { label: '备注', prop: 'remark', type: '' },
    { label: '回传状态', prop: 'AAA',  type: '' },
    { label: '修改时间', prop: 'updated_at', width: '160', type: '' },
    { label: '创建时间', prop: 'check_time', width: '160', type: '' },
]
export const MakeWarehouseInfoCloums = [
    { label: '产品编码', prop: 'spec_no', width: '150', },
    // { label: '货品编码', prop: 'stockin_no', width: '140',},
    { label: '产品名称', prop: 'name', width: '260' },
    { label: '规格名称', prop: 'specification', width: '100' },
    { label: '品牌', prop: 'brand', width: '70' },
    { label: '条形码', prop: 'barcode', width: '140' },
    { label: '货区类型', prop: 'AAA', width: '100' },
    { label: '货位', prop: 'AAA', width: '100', type: '' },
    { label: '批次', prop: 'batch_no', width: '120', type: '' },
    { label: '生产日期', prop: 'AAA', width: '160', type: '' },
    { label: '有效期', prop: 'expire_date', width: '160', type: 'time' },
    { label: '库存数量', prop: 'all_quantity', width: '160', type: 'number' },
    { label: '实际盘点数量', prop: 'new_num', width: '160', type: 'number' },
    { label: '箱规', prop: 'AAA', width: '160', type: '' },
    { label: '箱数', prop: 'AAA', width: '160', type: 'number' },
    { label: '盈亏', prop: 'quantity', width: '160', type: 'number' },
    { label: '单品备注', prop: 'remark', width: '160', type: '' },
]

/**
 * *****库存查询
 */

export const CheckSearch = [
    {  label: '品牌', prop: 'assistant_id', type: 'select', multiple: true },
    {  label: '条码', prop: 'barcode', type: 'input', multiple: false },
    {  label: '产品编码', prop: 'number', type: 'autocomplete', multiple: false },
    {  label: '产品名称', prop: 'name', type: 'autocomplete', multiple: false },
    {  label: '一级类目', prop: 'class_id1', type: 'select_1', multiple: true },
    {  label: '二级类目', prop: 'class_id2', type: 'select_2', multiple: true },
    {  label: '系列', prop: 'xl_id', type: 'select', multiple: true },
]
// 复合筛选项
export const CheckCompositeSearch = [
    {  label: '总库存', value: 'quantity', },
    {  label: '订单占有', value: 'order_own_num', },
    {  label: '可用库存', value: 'available_num', },
    {  label: '待发货量', value: 'sending_num', },
    {  label: '采购在途', value: 'procure_num', },
    {  label: '调拨在途', value: 'allocate_num', },
]
export const CheckCloums = [
    { label: '产品编码', prop: 'spec_no', width: '160'},
    { label: '条码', prop: 'barcode', width: '140',},
    { label: '品牌', prop: 'brand', width: '90' },
    { label: '产品名称', prop: 'name',width: '300' },
    { label: '规格型号', prop: 'specification', width: '120' },
    { label: '总库存', prop: 'quantity', width: '120', type: 'number' },
    { label: '订单占有', prop: 'order_own_num', width: '100', type: 'custom' },
    { label: '可用库存', prop: 'available_num', type: 'number', width: '100', },
    { label: '待发货量', prop: 'sending_num', width: '100', type: 'number' },
    { label: '采购在途', prop: 'procure_num', width: '100', type: 'number' },
    { label: '调拨在途', prop: 'allocate_num', width: '100', type: 'number' },
    { label: '一级类目', prop: 'class_id1_name', width: '100', type: '' },
    { label: '二级类目', prop: 'class_id2_name', width: '100', type: '' },
    { label: '系列', prop: 'xl_id_name', width: '140', type: '' },
]
// 订单占有弹窗
export const CheckOrderCloums = [
    { label: '订单编号', prop: 'order_no', width: '160'},
    { label: '订单类型', prop: 'order_type_str', width: '100'},
    { label: '订单状态', prop: 'order_status_str', width: '110' },
    { label: '客户', prop: 'customer_name' },
    { label: '销售组织', prop: 'sales_org_name', width: '100' },
    { label: '结算组织', prop: 'settle_org_name', width: '90', type: '' },
    { label: '数量', prop: 'order_own_num', width: '80', type: 'number' },
    { label: '付款时间', prop: 'created_at', type: '', width: '160', },
]

/**
 * 库存明细查询
 */
export const CheckDetailSearch = [
    {  label: '品牌', prop: 'assistant_id', type: 'select', multiple: true },
    {  label: '仓库', prop: 'wms_warehouse', type: 'select', multiple: true },
    {  label: '条码', prop: 'barcode', type: 'input', multiple: false },
    {  label: '产品编码', prop: 'number', type: 'select', multiple: false },
    {  label: '产品名称', prop: 'name', type: 'select', multiple: false },
    {  label: '批次', prop: 'batch_no', type: 'select', multiple: false },
    {  label: '一级类目', prop: 'class_id1', type: 'select_1', multiple: true },
    {  label: '二级类目', prop: 'class_id2', type: 'select_2', multiple: true },
    {  label: '系列', prop: 'xl_id', type: 'select', multiple: true },
]
// 复合筛选项
export const CheckDetailCompositeSearch = [
    {  label: '总库存', value: 'quantity', },
    // {  label: '订单占有', value: 'order_own_num', },
    // {  label: '可用库存', value: 'available_num', },
    // {  label: '待发货量', value: 'sending_num', },
    {  label: '采购在途', value: 'procure_num', },
    {  label: '调拨在途', value: 'allocate_num', },
    {  label: '生产日期', value: 'product_date', },
    {  label: '有效期', value: 'expire_date', },
]
export const CheckDetailCloums = [
    { label: '仓库', prop: 'short_name', width: '120'},
    { label: '品牌', prop: 'brand', width: '80',},
    { label: '产品编码', prop: 'spec_no', width: '150' },
    { label: '条码', prop: 'barcode', width: '140' },
    { label: '产品名称', prop: 'name', width: '300' },
    { label: '规格型号', prop: 'specification', width: '90', type: '' },
    { label: '批次', prop: 'batch_no', width: '120', type: '' },
    { label: '生产日期', prop: 'product_date', width: '160', type: 'time', },
    { label: '有效期', prop: 'expire_date', width: '160', type: 'time' },
    { label: '总库存', prop: 'quantity', width: '100', type: 'number' },
    // { label: '订单占有数', prop: 'order_own_num', width: '100', type: 'custom' },
    // { label: '仓库待发数', prop: 'sending_num', width: '100', type: 'number' },
    // { label: '可用库存', prop: 'available_num', width: '100', type: 'number' },
    { label: '采购在途数', prop: 'procure_num', width: '100', type: 'number' },
    { label: '调拨在途数', prop: 'allocate_num', width: '100', type: 'number' },
    { label: '一级类目', prop: 'class_id1_name', width: '100', type: '' },
    { label: '二级类目', prop: 'class_id2_name', width: '100', type: '' },
    { label: '系列', prop: 'xl_id_name', width: '140', type: '' },
]

/**
 * 主仓明细账
 */
export const WarehouseSearch = [
    {  label: '业务类型', prop: 'type_name', type: 'select', multiple: true },
    {  label: '单据时间', prop: 'created_at', type: 'time', multiple: false },
    {  label: '出入库单号', prop: 'change_no', type: 'input', multiple: false },
]
export const WarehouseCloums = [
    { label: '业务类型', prop: 'type_name', width: '100'},
    { label: '日期', prop: 'created_at', width: '160',},
    { label: '库存增减量', prop: 'stock_change_num', width: '140', type: 'number' },
    { label: '增减后库存', prop: 'stock_num', width: '140', type: 'custom' },
    { label: '出入库单号', prop: 'change_no', width: '160' },
    { label: '订单号', prop: 'order_no', width: '120', type: '' },
    { label: '仓库', prop: 'short_name', type: '' },
    { label: '仓库信息', prop: 'warehouse_note', type: '', width: '120', },
    { label: '客户', prop: 'customer_note', width: '100', type: '' },
    { label: '操作人', prop: 'create_user_name', width: '100', type: '' },
]


/* 寄售查询 */
export const ConsignSaleSearch = [
  {  label: '品牌', prop: 'assistant_id', type: 'select', multiple: true },
  {  label: '仓库', prop: 'wms_warehouse', type: 'select', multiple: true },
  {  label: '条码', prop: 'barcode', type: 'input', multiple: false },
  {  label: '产品编码', prop: 'number', type: 'autocomplete', multiple: false },
  {  label: '产品名称', prop: 'name', type: 'autocomplete', multiple: false },
  {  label: '一级类目', prop: 'class_id1', type: 'select_1', multiple: true },
  {  label: '二级类目', prop: 'class_id2', type: 'select_2', multiple: true },
  {  label: '系列', prop: 'xl_id', type: 'select', multiple: true },
]
// 复合筛选项
export const ConsignSaleCheckCompositeSearch = [
  {  label: '总库存', value: 'quantity', },
  {  label: '订单占有', value: 'order_own_num', },
  {  label: '可用库存', value: 'available_num', },
]
export const ConsignSaleCheckCloums = [
  { label: '产品编码', prop: 'spec_no', width: '160'},
  { label: '条码', prop: 'barcode', width: '140',},
  { label: '仓库', prop: 'short_name', width: '120'},
  { label: '品牌', prop: 'brand', width: '90' },
  { label: '产品名称', prop: 'name',width: '300' },
  { label: '规格型号', prop: 'specification', width: '120' },
  { label: '批次', prop: 'batch_no', width: '140', type: '' },
  { label: '有效期', prop: 'expire_date', width: '160', type: 'time' },
  { label: '总库存', prop: 'quantity', width: '120', type: 'number' },
  // { label: '订单占有', prop: 'order_own_num', width: '100', type: 'custom' },
  { label: '可用库存', prop: 'available_num', type: 'number', width: '100', },
  { label: '一级类目', prop: 'class_id1_name', width: '100', type: '' },
  { label: '二级类目', prop: 'class_id2_name', width: '100', type: '' },
  { label: '系列', prop: 'xl_id_name', width: '140', type: '' },
]
